<template>
    <div class="form-body">
        <tool-bar/>
        <el-container class="container">
            <el-row>
                <el-col :span="24">
                    <div class="breadcrumb">
                        <el-breadcrumb separator="/">
                            <el-breadcrumb-item><i class="el-icon-lx-calendar"></i> 表单</el-breadcrumb-item>
                            <el-breadcrumb-item>枚举数据新增</el-breadcrumb-item>
                        </el-breadcrumb>
                    </div>
                </el-col>
                <el-col :span="24">
                    <el-card class="card" shadow="hover">
                        <div slot="header" class="clearfix">
                            <center>
                                <span>基本信息</span>
                            </center>
                        </div>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item  label="ID">
                                        <el-input class="input" v-model="form.fdId"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item  label="创建时间">
                                        <el-input class="input" v-model="form.fdCreateTime"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item  label="显示值">
                                        <el-input class="input" v-model="form.fdName"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item  label="实际值">
                                        <el-input class="input" v-model="form.fdValue"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item  label="排序号">
                                        <el-input class="input" v-model="form.fdOrder"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item  label="关联枚举id">
                                        <el-input class="input" v-model="form.fdMainId"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                    </el-card>
                </el-col>
            </el-row>
        </el-container>
    </div>
</template>
<script>
import ToolBar from '@/components/form/ToolBar';
import dateUtils from '@/utils/dateUtils';
import formUtils from '@/utils/formUtils';
export default {
    name: "sysEnumsDataView",
    components: {
        ToolBar
    },
    data() {
        return {
            form: {
                fdId:'',
                fdCreateTime:'',
                fdName:'',
                fdValue:'',
                fdOrder:'',
                fdMainId:''
            },
            labelPosition:'right',
            fullscreenLoading:false
        }
    },
    created() {
        this.initParam();
    },
    methods: {
        initParam() {
            let fdId = this.$route.query.id;
            if(formUtils.isNotEmpty(fdId)){
                this.fullscreenLoading = true;
                this.$fetch('/api/sys/enums/sys_enums_data',{
                    id:fdId
                }).then((res) => {
                    formUtils.convertToForm(res.data,this.form);
                    this.fullscreenLoading = false;
                });
            }
        }
    }
}
</script>
<style scoped >
@import "~@/assets/css/form.css";
</style>